<%# <%= content_tag(:div, "", id: "app") %> 

<% if false %>
    <% if current_user %>
        <h5><%= current_user.email %></h5>
    <%end%>
    <%=
        link_to_if(current_user.nil?, "登陆", sign_in_path, class: 'btn btn-primary m-5') do
            link_to('注销',  destroy_user_session_path, :method => 'delete', class: 'btn btn-danger m-5')
        end
    %>
    <% end %>

<div class="navbar">

<div>校园二手交易平台</div>

<span><%= link_to "首页", list_goods_path %></span>
<% if user_signed_in? %>
<span><%= link_to "私信", rooms_path %></span>
  <span><%= link_to "交易记录", history_user_path(current_user) %></span>
<% end %>
<span><%= link_to "搜索", find_goods_path %></span>
<% if current_user %>
  <% if current_user.admin? %>
    <span><%= link_to "管理用户", list_users_path %></span>
  <% end %>
    <span><%= link_to "用户中心", user_path(current_user) %></span>
<% end %>

<div class="navbar-right">
<% if user_signed_in? %>
<%= link_to "发布商品  ", publish_goods_path %>
<%= link_to "我的发布", user_goods_path(current_user) %>
  欢迎，<strong><%= current_user.username %></strong>!
  <%= link_to "修改信息", edit_user_registration_path, :class => 'navbar-link' %> |
  <%= link_to "登出", destroy_user_session_path, method: :delete, :class => 'navbar-link'  %>
<% else %>
  <%= link_to "注册", new_user_registration_path, :class => 'navbar-link'  %> |
  <%= link_to "登陆", new_user_session_path, :class => 'navbar-link'  %>
<% end %>
</div>

</div>
